import { Body, Controller, Post } from '@nestjs/common'
import { DocService } from '@/service'
import { QueryDocDto } from '@/controller/doc/doc.dto'

@Controller('doc')
export class DocControllers {
    constructor(private readonly docService: DocService) {}

    @Post('queryToc')
    public async queryToc(@Body() data: any) {
        return await this.docService.queryToc(data.companyName)
    }

    @Post('queryDoc')
    public async queryDoc(@Body() data: QueryDocDto) {
        const { docid, docTitle, companyName } = data
        return await this.docService.queryDoc(docid, docTitle, companyName)
    }
}
